Proposed by Om Prakash (profile, biography) Don't forget to submit this proposal to official Google Melange site too!
How will I do that project:-
Allowing Squeak to be called as a DLL would enable use of Smalltalk code by a wider audience and ease the creation of Squeak plug-ins for systems like Apache, web browsers, CAD systems and so on.
There are two approaches to creating the Squeak.dll for desired systems like CAD, Web browsers, Apache etc. They are the “Passive Architecture” and “Active Architecture”.
In the “Passive Architecture”, Squeak.dll will be inactive until called from by the calling program and will halt just after Squeak.dll returns the result to the caller. This Architecture might be more limit than the Active Architecture but is a lot simpler to implement.
In the “Active Architecture”, Squeak.dll will be active all the time as a separate thread once loaded. It will then be able to accept incoming calls from separate threads or generate new threads to carry out complex processes. This architecture will provide the full range of Squeak facilities such as delays, light-weight processes, callbacks, etc.
I will implement the following:
What methodologies will I use:-
- Modify VM and Smalltalk to allow the following:
- main.exe loads Squeak.dll.
- main.exe will call SqueakInit() which will run Squeak.dll from entry point to right before interpret() loop.
- main.exe will prompt user for input of Smalltalk command, eg,"3+4", "3 class" or "3 asFloat". And this input will be the sqExp to send to Squeak.dll.
- main.exe call SqueakInterp(sqExp), passing Smalltalk command to Squeak.dll and run the interpreter
- The interpreter will hit the "Smalltalk processDLLString" process which calls a primitive to read sqExp, compiles it, executes it and returns result asPrintString.
- main.exe then prints the result returned by Squeak.dll.
- Again, main.exe will prompt user for Smalltalk command, call SqueakInterp() etc.
- Extend above to accept and return pointer to complex objects.
- Add functions to access and modify Smalltalk objects from main.exe.
- Make a simple plug-in for AutoCAD using Squeak.dll. Hence user inputs and AutoCAD entities can be modified by Smalltalk in Squeak.
- Study THAPI and begin implementation of Active Architecture.
Suggested timeline and milestones:-
- I will start on 15th of May
- First month:
- Extend Passive Architecture to accept and return pointer to complex objects.
- Add functions to access and modify Smalltalk objects from main.exe.
- Share Squeak.dll to developers and solicit feedback. I will distill all the feedback from users and reviewers and incorporate suggestions into Squeak.dll.
- Second Month: Make a simple plug-in for AutoCAD using Squeak.dll. Hence user inputs and AutoCAD entities can be modified by Smalltalk in Squeak.
- Third Month and more: Study THAPI and begin implementation of Active Architecture.
- Thorough testing of work done to date. I will refractor and document the code thoroughly then package it for easy distribution and install.
Where I see the risks :-
- VM programming and multithreading can be complex. But I can get the help of my mentors who are very experienced in these areas.
How the results will look like :-
- Squeak.dll will be made callable like any DLL from any executable program. To demonstrate its capabilities this project with show Squeak.dll integrated with AutoCAD and modifying user inputs and AutoCAD entities with Smalltalk in Squeak.
|